﻿// JScript 文件
var strAirport="http://live.emoney.cn/airport22/";
var strAirportPic="http://live.emoney.cn/";

//指标，线介绍
var ZbExplane=[//0
               "<span class='z_grey'>【资金博弈】:</span><span class=\"z_purple\">紫色线</span><span class=\"z_dyellow\">向上，表示主力吸筹，后市上涨动能足！</span><span class=\"z_green\">绿色线</span><span class=\"z_dyellow\">引头向上，散户增持持股，股价下跌风险大。</span>",  //zjby
               //1
               "<span class='z_grey'>【大单比率】:</span><span class=\"z_dyellow\">大单比率</span><span class=\"z_red\">红柱</span><span class=\"z_dyellow\">表示主力大单净买入量大，强势进场！</span><span class=\"z_green2\">绿柱</span><span class=\"z_dyellow\">表示资金大单净卖出量较多，资金离场。</span>",  //KDJ
               //2
                "<span class='z_grey'>【上证指数-乾坤图】:</span><span class=\"z_dyellow\">大盘处在</span><span class=\"z_blue\">蓝色区间</span><span class=\"z_dyellow\">，预警大盘趋弱，注意控制仓位风险！</span>",//上正kx1_1
               //3
               //上正kx1_2
               "<span class='z_grey'>【上证指数-乾坤图】:</span><span class=\"z_dyellow\">大盘处在</span><span class=\"z_red\">红色区域</span><span class=\"z_dyellow\">，表明趋势走好，可关注机会，重仓操作！</span>",
               //4
               "<span class='z_grey'>【深证成指】:</span><span class=\"z_dyellow\">指数发出<span class=\"z_red\">B点</span>，处在<span class=\"z_red\">红色</span>阶段，表明趋势走好，重仓操作更安全！</span>",
               //5
               "<span class='z_grey'>【深证成指】:</span><span class=\"z_dyellow\">指数发出<span class=\"z_blue\">S点</span>，或处<span class=\"z_blue\">蓝色</span>阶段，表示风险来临，及时控仓位！</span>",
               //6
               "<span class='z_grey'>【操盘线-日线】:</span><span class=\"z_dyellow\"> <span class=\"z_red\">B点</span>买进，坐涨拉升波段；<span class=\"z_green\">S点</span>卖出，及时规避下跌。</span>",
               //7
               "<span class='z_grey'>【操盘线-日线】:</span><span class=\"z_dyellow\">处于<span class=\"z_red\">红色</span>阶段，持股待涨；处于<span class=\"z_blue\">蓝色</span>阶段，持币观望，让买卖更轻松！</span>",
               //8
               "<span class='z_grey'>【操盘线-周线】:</span> <span class=\"z_dyellow\">周线<span class=\"z_red\">B点</span>发出，中期行情启动，买入更安全；中期走弱，<span class=\"z_green\">S点</span>及时警示，注意风险控制。</span>",
               //9
               "<span class='z_grey'>【操盘线-周线】:</span> <span class=\"z_dyellow\">周线与日线同时出<span class=\"z_red\">B点</span>，上涨潜能更足，买入机会更佳。</span>",
               //10
               "<span class='z_grey'>【操盘线-60分钟】:</span><span class=\"z_dyellow\"> 按60分钟<span class=\"z_red\">B</span><span class=\"z_green\">S</span>点买卖，大幅提升短线胜率，安全快进快出。</span>",
               //11
               "<span class='z_grey'>【K线】:</span><span class=\"z_dyellow\"> 点击顶部“<span class=\"z_red\">B</span><span class=\"z_green\">S</span>|<span class=\"z_blue\">分时</span>”按钮，切换为操盘线视图，轻松查看个股黄金买卖点！</span>",
              "MACD",  //分时
              "ZJBY", //ZJBY
              "DDBL" ,  //DDBL
              "MA" ,//MA
              "TIMESHARE"  //TIMESHARE
              
]


function LocationHref(url)
{
   window.location.href=url; 
}


//数字是否undefined
function IsNumUndefined(num)
{
   if(num==undefined)
   {
      return 0;
   }
   else
   {
      return num;
   }
}

//str是否undefine
function IsStrUndefined(str)
{
   if(str==undefined)
   {
      return "";
   }
   else
   {
      return str;
   }
}

function Sleep(obj,iMinSecond)   
{   
   if (window.eventList==null)   
   window.eventList=new Array();   
   var ind=-1;   
   for (var i=0;i<window.eventList.length;i++)   
   {     
    if (window.eventList[i]==null)   
    {   
     window.eventList[i]=obj;      
     ind=i;     
     break;     
    }   
   }   
   if (ind==-1)   
   {     
    ind=window.eventList.length;     
    window.eventList[ind]=obj;   
   }   
   setTimeout("GoOn(" + ind + ")",iMinSecond);   
}   
function GoOn(ind)   
{   
   var obj=window.eventList[ind];   
   window.eventList[ind]=null;   
   if (obj.NextStep) obj.NextStep();   
   else obj();   
}   
  


//是否时手机号
function IsMobile(value)
{
    var pattern = /^(13[0-9]|15[0-9]|18[0-9])\d{8}$/;
    if(pattern.test(value))
	    return true;
    return false;	
}

//联想功能
function show_num(num)
{
 
  var eo=document.getElementById("suggest1");
  var eofirst=eo.value.substring(0,1);
  //首字是2或9的代码不触发事件
  if(eofirst=='2'||eofirst=='9')
  {
     if(eo.value.length<6 && num>=0)
     {
       eo.value=eo.value+num;
       return false;
     }
  }
  else if(eofirst=='')
  {
     if((num=="2" || num=='9') )
     {
        eo.value=eo.value+num;
        return false;
     }
  }
  
  if(num=="-2")
  {
      //事件触发
      eo.value="^";
      FireEvent("suggest1","keydown");
      eo.value="";
  }
  else if(num=="-1")
  {
    if(eo.value.length!=0)
    {
       eo.value=eo.value.substring(0,eo.value.length-1);
       if(eo.value!='')
       {
        eo.focus();
        FireEvent("suggest1","keydown");
       }
    } 
  }
//  else if((num=="2" || num=='9') )
//  {
//     if(eo.value.length==0)
//     {
//       eo.value=eo.value+num;
//     }
//     else
//     {
//        if(eo.value.length<6)
//        {
//          eo.value=eo.value+num;
//          eo.focus();
//          FireEvent("suggest1","keydown");
//        }
//     }
//  
//  }
  else
  {
    if(eo.value.length<6  )
    {
      
      eo.value=eo.value+num;
      eo.focus();
      FireEvent("suggest1","keydown");
    }
  }
  //自动刷新
//  clearTimeout(document.getElementById("refreshtime").value); 
//  var timeoutid=window.setTimeout("AutoMaskDisplay()", 15000);
//  document.getElementById("refreshtime").value=timeoutid
}

//模拟手机键盘事件
function show_mobile(num)
{

  var eo=document.getElementById("txt_mobile");
  var seo=document.getElementById("s_mobile");
  if(num=="-2"){eo.value="";}
  else if(num=="-1")
  {
    if(eo.value.length!=0)
    {
       eo.value=eo.value.substring(0,eo.value.length-1);
    }
  }
  
  else
  {
   if(eo.value.length<11)
    {
      eo.value=eo.value+num;
    }
  }

  seo.innerHTML=eo.value;
}

function show_mobile1(num)
{

  var eo=document.getElementById("txt_mobile1");
  var seo=document.getElementById("s_mobile1");
  if(num=="-2"){eo.value="";}
  else if(num=="-1")
  {
    if(eo.value.length!=0)
    {
       eo.value=eo.value.substring(0,eo.value.length-1);
    }
  }
  
  else
  {
   if(eo.value.length<11)
    {
      eo.value=eo.value+num;
    }
  }

  seo.innerHTML=eo.value;
}

//显示遮罩层
function DivDoMask()
{

      $("#suggest1").val('');
      $("#txt_mobile").val('');
      $("#s_mobile").html('');
      $("#s_code").html('');
      $("#dial_mask").css("display","");
//      var timeoutid=window.setTimeout("AutoMaskDisplay()", 15000);
//      document.getElementById("refreshtime").value=timeoutid
}
//取消遮罩层
function DivDoNotMask()
{ 
      $("#dial_mask").css("display","none");
      //clearTimeout(document.getElementById("refreshtime").value); 
}

function AutoMaskDisplay()
{
      $("#suggest1").val('^'); //触发一个空事件
      FireEvent("suggest1","keydown");
      MM_showHideLayers('cg','','hide');
      MM_showHideLayers('gpdm','','hide');
      MM_showHideLayers('sjh','','hide');
      $("#dial_mask").css("display","none");  
      clearTimeout(document.getElementById("refreshtime").value); 
}


function AutoMaskDisplay3()
{
      MM_showHideLayers('cg','','hide');
      MM_showHideLayers('gpdm','','hide');
      MM_showHideLayers('sjh','','hide');
      $("#dial_mask").css("display","none");  
}
//如果停牌相应位置“－－”
function GetIsStop(data)
{
    $.each(data,function(i){    
        var obj=data[i];
        for(var p in obj) 
        { 
            if(obj[p]==0 )
            {
                if(p!="F" && p!="I")
                {
                  obj[p]="--"
                }
            }
        } 
    });
}

//获得参数
function getQueryString(){
        var name,value,i;
        var str=location.href;
        var num=str.indexOf("?")
        str=str.substr(num+1);
        var arrtmp=str.split("&");
        for(i=0;i < arrtmp.length;i++){
                num=arrtmp[i].indexOf("=");
                if(num>0){
                        name=arrtmp[i].substring(0,num);
                        value=arrtmp[i].substr(num+1);
                        this[name]=value;
                }
        }
}



//返回指定的URL参数,自动将URL解码
function getQueryStr(key){
  return decodeURI(getQueryString(key));
}

function Image_normal(id,pid)
{
  document.getElementById(id).src=pid;
}

function Image_normal1(id,pid)
{
   window.setTimeout("Image_normal('"+id+"','"+pid+"')", 150); 
}



//获得数字单位
function ChangeValueUnits(numValue)
{
   var result;
   var strValue='';
   //如果时负数则数字少一位
   //定义小数点前位数
   var weishu=0;
   if(isNaN(numValue))
   {
      return ;
   }
   else
   { 
       if (numValue<0)
	    {
		    numValue = -numValue;
		    strValue = "-";
		    weishu=3;
	    }
	    else
	    {
		    strValue = "";
		    weishu=4;
		}
   }
   numValue=parseFloat(numValue);
   if (numValue>=100000000)
   {
       result=String(numValue/100000000);
       
       if(result.indexOf('.')!=-1)
       {
          if(result.indexOf('.')<=weishu)
          {
             result=result.substring(0,result.indexOf('.'))+'.'+result.substring(result.indexOf('.')+1,result.indexOf('.')+2)+'亿';
          }
          else
          {
             result=result.substring(0,result.indexOf('.'))+'亿';
          } 
       }
       else
       {
          result=result+'亿';
       }
   }
   else if(numValue>=10000 && numValue< 100000000)
   {
       result=String(numValue/10000);
       
        if(result.indexOf('.')!=-1)
       {
          if(result.indexOf('.')<=weishu)
          {
             result=result.substring(0,result.indexOf('.'))+'.'+result.substring(result.indexOf('.')+1,result.indexOf('.')+2)+'万';
          }
          else
          {
             result=result.substring(0,result.indexOf('.'))+'万';
          }
          
       }
       else
       {
          result=result+'万';
       }
   }
   else
   {   
       result=String(numValue);
       result=result.substring(0,6);
   }
   return strValue+result;
 
}



function FireEvent(controlID, eventName)
{
    if (document.all)    // For IE.
     {
        //eval("document.getElementById(\"" + controlID + "\")." + eventName + ";");
        document.getElementById( controlID ).fireEvent("on"+eventName);
     }
    else    // For Nescape
     {
         var e = document.createEvent('HTMLEvents');
         e.initEvent(eventName, false, false);
         document.getElementById(controlID).dispatchEvent(e);
     }
}

//判断是否全是字母
function IsString(string1)
{
    var hh=false;
    for(i=0;i<string1.length;i++)
    {
        if(parseInt(string1.toLowerCase().charCodeAt(i))>=97 && parseInt(string1.toLowerCase().charCodeAt(i))<=122)
        {
           hh=true;
        }
        else
        {
        
        hh=false;
        break;
          
        }   
    }
    return hh
}




function Clear()
{
   document.getElementById('suggest1').value='';
}

//num2为标准数
function GetColorByCompare(num1,num2)
{

   var strReturn ='';
   var num=num1-num2;
   if(num<0)
   {
      strReturn='color_green';
   }
   else if(num=0)
   {
      strReturn='color_black';
   }
   else 
   {
      strReturn='color_red';
   }
   return strReturn;
}

//颜色
function GetColorByZero1(num)
{

   var strReturn ='';
   if(num<0)
   {
      strReturn='color_green';
   }
   else if(num=0)
   {
      strReturn='color_black';
   }
   else 
   {
      strReturn='color_red';
   }
   return strReturn;
}

//------------------------
//index2.html
//------------------------
function DisappearRedBottom()
{
    $('img[type=bottomfont]').css("display","none");
    $('#yxb').css("display","none");
    $('#yxb2').css("display","none");
}

function GetAd(type)
{
  DisappearRedBottom();
  switch(type)
  {
     case "today":
//       $('#adpic').css("display","none");
//       $('#today').css("display","");
//       $('#wz1b').css("display","");       
//       GetIndex2Today();
       RequestCountWithUrl('jrhq2','airport.html?type=INDEX&id=000001');
       //window.location.href='airport.html?type=INDEX&id=000001';
       break;
     case "redblue":
//       $('#today').css("display","none");
//       $('#adpic').css("display","");
//       $('#wz3b').css("display","");
//       $('#yxb').css("display","");
//       GetRedBlueList();   //红蓝列表
//       $('#yxb2').css("display","");
//       $('#yxb2_pic').attr("src",strAirportPic+"ashx/StockImg.ashx?key=EMONEY_MAP_1.0_GOODS_HERO_CPX_DAY_"+ $('#redbluecode').val()+"_800x604_58&ImgType=GIF&Ip=Airport_Index22_Test");
//       $('#adpic').attr("src","images/红蓝牛股池.jpg");
       
       GetRedBlueCode();    
       RequestCountWithUrl('hlngc2','airport.html?type=GOODS&id='+ $('#redbluecode').val()+'&RB=1');
       //window.location.href='airport.html?type=GOODS&id='+ $('#redbluecode').val()+'&RB=1';
       break;
     case "watch":
//       $('#today').css("display","none");
//       $('#adpic').css("display","");
//       $('#wz4b').css("display","");
//       //$('#adpic').attr("src","images/仓位马力表.png");
//       GetCWB("big");
       //RequestCount('cwmlb2');
       RequestCountWithUrl('cwmlb2','airport.html?type=INDEX&id=000001');
       break;
     case "big":
//       $('#today').css("display","none");
//       $('#adpic').css("display","");
//       $('#wz2b').css("display","");
//       $('#adpic').attr("src","images/大势乾坤图.png");
       RequestCountWithUrl('dsqkt2','airport.html?type=INDEX&id=000001');
       //window.location.href='airport.html?type=INDEX&id=000001';
       break;
     case "bs":
//       $('#today').css("display","none");
//       $('#adpic').css("display","");
//       $('#wz5b').css("display","");
//       $('#adpic').attr("src","images/BS操盘线.png");
       RequestCountWithUrl('bsdcpx2','airport.html?type=INDEX&id=399001');
       //window.location.href='airport.html?type=INDEX&id=399001';
       break;
     case "main":
//       $('#today').css("display","none");
//       $('#adpic').css("display","");
//       $('#wz6b').css("display","");
//       $('#adpic').attr("src","images/主力追踪.png");
       RequestCountWithUrl('zlzj2','airport.html?type=INDEX&id=399001');
       //window.location.href='airport.html?type=INDEX&id=399001';
       break;
     case "1":
       $('#adpic').css("display","none");
       $('#today').css("display","");
       $('#wz1b').css("display","");
       GetIndex2Today();
       break;
     case "2":
       $('#today').css("display","none");
       $('#adpic').css("display","");
       $('#wz2b').css("display","");
       $('#yxb2').css("display","");
       $('#yxb2_pic').attr("src","images/airport/乾坤图 PS.png");
       $('#adpic').attr("src","images/airport/乾坤图.jpg");
       break;
     case "3":
     
       $('#today').css("display","none");
       $('#adpic').css("display","");
       $('#wz3b').css("display","");
       $('#yxb').css("display","");
      
       $('#yxb2').css("display","");
       $('#yxb2_pic').attr("src",strAirportPic+"ashx/StockImg.ashx?key=EMONEY_MAP_1.0_GOODS_HERO_CPX_DAY_"+ $('#redbluecode').val()+"_800x604_58&ImgType=GIF&Ip=Airport_Index22_Test");
       GetRedBlueList();   //红蓝列表
       $('#adpic').attr("src","images/airport/红蓝牛股池.jpg");
       break;
      
     case "4":
     
       $('#today').css("display","none");
       $('#adpic').css("display","");
       $('#wz4b').css("display","");
       //$('#adpic').attr("src","images/airport/仓位马力表.png");
       GetCWB("big");
       break;
     case "5":
       $('#today').css("display","none");
       $('#adpic').css("display","");
       $('#wz5b').css("display","");
       $('#yxb2').css("display","");
       $('#yxb2_pic').attr("src","images/airport/操盘线PS.png");
       $('#adpic').attr("src","images/airport/操盘线.jpg");
       break;
     case "0":
       $('#today').css("display","none");
       $('#adpic').css("display","");
        $('#wz6b').css("display","");
       $('#yxb2').css("display","");
       $('#yxb2_pic').attr("src","images/airport/主力追踪PS.png");
       $('#adpic').attr("src","images/airport/主力资金.jpg");
       break;
  }
}


//显示今日行情数据
function  GetIndex2Today()
{
  
  var d=new Date();
  $('#todaypic').attr("src",strAirportPic+"ashx/StockImg.ashx?key=EMONEY_MAP_1.0_SCQJ_450x362_58&ImgType=GIF&Ip=Airport_Index22_TIMESHARE&time="+d.getTime());

  $.getJSON(strAirport+"Airport22.ashx?jsoncallback=?",{action:"GetPh"},
      function(json)
      {

          var data=eval(json[0].info);
          //var data=$.toJSON(json[0].info);

          if(data[0].D[0].C!="")
	        {
	            var shaup= GetPhTable(data[0],"沪A股","color_red");
	            $('#shaup').html(shaup);
	        }
	      if(data[1].D[0].C!="")
	        {
	            var shadown= GetPhTable(data[1],"沪A股","color_green");
	            $('#shadown').html(shadown);
	        }
	      if(data[2].D[0].C!="")
	        {
	            var szaup= GetPhTable(data[2],"深A股","color_red");
	            $('#szaup').html(szaup);
	        }
	      if(data[3].D[0].C!="")
	        {
	            var szadown= GetPhTable(data[3],"深A股","color_green");
	            $('#szadown').html(szadown);
	        }
      }
      );
}



function GetPhTable(data,name,color)
{
  var strTable;
  strTable= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
  strTable=strTable+ "<tr class=\"color_white\">";
  strTable=strTable+ "<td height=\"30\" align=\"center\" bgcolor=\"#2f2f2f\">"+name+"</td>";
  strTable=strTable+ "<td align=\"center\" bgcolor=\"#2f2f2f\" class=\""+color+"\">价格</td>";
  strTable=strTable+ "<td align=\"center\" bgcolor=\"#2f2f2f\" class=\""+color+"\">涨幅</td>";
  strTable=strTable+ "</tr>";
  var count=data.D.length;
  if(count>5)
	   count=5;
  for(i=0;i<count;i++)
     {
         strTable=strTable+"<tr class=\"color_white\">";
         strTable=strTable+"<td height=\"30\"  align=\"center\" class=\"color_yellow\">"+data.D[i].N+"</td>";
         strTable=strTable+"<td align=\"center\" class=\""+color+"\">"+data.D[i].P+"</td>";
         strTable=strTable+"<td align=\"center\" class=\""+color+"\">"+data.D[i].F+"%</td>";
         strTable=strTable+"</tr>";
     }
  strTable=strTable+"</table>";
  return strTable;
}


//显示涨跌排行
function  GetZdph()
{
      $.getJSON(strAirport+"Airport22.ashx?jsoncallback=?",{action:"GetPh"},
      function(json)
      {
            var data=eval(json[0].info);
            if(data[0].D[0].C!="")
	        {
	            var shaup= GetZdTable(data[0],"沪A股","z_red2");
	            $('#zdph_1').html(shaup);   
	        }
	        if(data[1].D[0].C!="")
	        {
	            var shadown= GetZdTable(data[1],"沪A股","z_green");
	            $('#zdph_3').html(shadown);
	        }
	        if(data[2].D[0].C!="")
	        {
	            var szaup= GetZdTable(data[2],"深A股","z_red2");
	            $('#zdph_2').html(szaup);
	        }
	        if(data[3].D[0].C!="")
	        {
	            var szadown= GetZdTable(data[3],"深A股","z_green");
	            $('#zdph_4').html(szadown);
	        }
         
      }
      );

}

function GetZdTable(data,name,color)
{ 
    var strTable;
    strTable= ' <table width="458" border="0" cellspacing="0" cellpadding="0">';
    var count=data.D.length;
    if(count>10)
	   count=10;
	 for(i=0;i<count;i++)
     {
         strTable=strTable+"<tr onMouseOver=\"this.style.backgroundColor='#282828'\" onMouseOut=\"this.style.backgroundColor='#000000'\" onclick=\"InitialStockWithPic('"+data.D[i].C+"','GOODS','TEN');MM_showHideLayers('zdph','','hide','ngczjb','','hide','zdph1','','hide');\">";
         strTable=strTable+'<td width="99" height="25" style="padding-left:28px">'+data.D[i].N+'</td>';
         strTable=strTable+'<td width="95">'+IsStrUndefined(data.D[i].HY)+'</td>';
         strTable=strTable+'<td width="64" align="right"  class="'+color+'">'+data.D[i].P.toFixed(2)+'</td>';
         strTable=strTable+'<td width="90" align="right"  class="'+color+'">'+data.D[i].F.toFixed(2)+'</td>';
         strTable=strTable+'<td width="110" align="right" class="'+color+'" style="padding-right:26px">'+ChangeValueUnits(data.D[i].J)+'</td>';
         strTable=strTable+"</tr>";
     }
  strTable=strTable+"</table>";
    return strTable;
}

//首页红蓝表
function GetRedBlueList()
{
  $.getJSON(strAirport+"Airport22.ashx?jsoncallback=?",{action:"GetRedBlue"},
      function(json)
      { 
 
            var data=eval(json[0].info);
            //alert(data[1].D[0].C);
            
            var rb_count;
            var rb_table;
            if(data[0].D[0]!=undefined)
            {
               if(data[0].D[0].C!="" )
	           {    
	             rb_count=data[0].D.length;
	             if(rb_count>4)
	               rb_count=4;
	             rb_table=" <table width=\"235\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";  
	             for(i=0;i<rb_count;i++)
	             {
	                 if(i==0)
	                 {
	                    $('#redbluecode').val(data[0].D[i].C);    
	                 }
	                 var day= data[0].D[i].DATE.substring(2,4)+"/"+data[0].D[i].DATE.substring(4,6)
	              
	                 rb_table=rb_table+"<tr>";
	              
	                 rb_table=rb_table+" <td width=\"28\" align=\"center\" class=\"color_blue\">"+(i+1)+"</td>";
                     rb_table=rb_table+"<td width=\"55\" align=\"center\" class=\"color_blue\" >"+data[0].D[i].N+"</td>";
                     rb_table=rb_table+"<td width=\"53\" align=\"center\" class=\"color_red\" >+"+parseFloat(data[0].D[i].F*100).toFixed(2)+"%</td>";
                     rb_table=rb_table+"<td width=\"51\" align=\"center\" class=\"color_white\" >"+day+"</td>";
                     rb_table=rb_table+"<td align=\"center\" class=\"color_red\" >"+data[0].D[i].P+"</td>";
                     rb_table=rb_table+"</tr>";
	             }
	              rb_table=rb_table+"</table>"
	           }
            }       
            else
            {
               if(data[1].D[0].C!="")
	           {
	             var blue_count=data[1].D.length;
	             if(blue_count>4)
	               blue_count=4;
	             rb_table=" <table width=\"235\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";  
	             for(i=0;i<blue_count;i++)
	             {
	                 if(i==0)
	                 {
	                    $('#redbluecode').val(data[1].D[i].C);    
	                 }
 	                 var blueday= data[1].D[i].DATE.substring(2,4)+"/"+data[1].D[i].DATE.substring(4,6)
	             
	                 rb_table=rb_table+"<tr>";
	              
	                 rb_table=rb_table+" <td width=\"28\" align=\"center\" class=\"color_blue\">"+(i+1)+"</td>";
                     rb_table=rb_table+"<td width=\"55\" align=\"center\" class=\"color_blue\" >"+data[1].D[i].N+"</td>";
                     rb_table=rb_table+"<td width=\"53\" align=\"center\" class=\"color_red\" >+"+parseFloat(data[1].D[i].F*100).toFixed(2)+"%</td>";
                     rb_table=rb_table+"<td width=\"51\" align=\"center\" class=\"color_white\" >"+blueday+"</td>";
                     rb_table=rb_table+"<td align=\"center\" class=\"color_red\" >"+parseFloat(data[1].D[i].P).toFixed(2)+"</td>";
                     rb_table=rb_table+"</tr>";
	             }
	           
	             rb_table=rb_table+"</table>"
	            }   
            }        
            $('#redbluelist').html(rb_table);
      }
      ); 
}


//跳转红蓝表
function GetRedBlueCode()
{
  $.getJSON(strAirport+"Airport22.ashx?jsoncallback=?",{action:"GetRedBlue"},
      function(json)
      { 
            var data=eval(json[0].info);

            if(data[0].D[0]!=undefined)
            {
               if(data[0].D[0].C!="" )
	           {        
	             $('#redbluecode').val(data[0].D[0].C);         
	           }
            }       
            else
            {
               if(data[1].D[0].C!="")
	           {
	                 $('#redbluecode').val(data[1].D[0].C);    
	           }       
            }        
      }
      ); 
}




//------------------------
//airport.html
//------------------------
//提交手机号
function SubmitMobile() {    
    // MM_showHideLayers('sjh','','hide','cg','','show');
   var mobile=  $('#txt_mobile').val();
   if(IsMobile(mobile)) {
      WritePhoneLogs('00100', mobile);//写入日志文件
      $.getJSON(strAirport+"Airport22.ashx?jsoncallback=?",{action:"Register",mobile:mobile,sid:"111501",tid:"21"},
      function(json)
      {
         data=json[0].info;
         if(data== "获取密码成功，请注意查收！" || data=="注册成功，验证码已经发送到您手机，请注意查收！") 
         {
              MM_showHideLayers('sjh','','hide','cg','','show');
         }
         else
         {
             //alert(data);
             main.ShowMessage(data,3000);
         }
      }
      );
     
   }
   else
   {
      //alert("请输入正确的手机号！");
      main.ShowMessage("请输入正确的手机号！",3000);
      return false;
   }
}

function SubmitMobile1() {    
    // MM_showHideLayers('sjh','','hide','cg','','show');
   var mobile=  $('#txt_mobile1').val();
   if(IsMobile(mobile)) {
      WritePhoneLogs('00100', mobile);//写入日志文件
      $.getJSON(strAirport+"Airport22.ashx?jsoncallback=?",{action:"RegisterOutOfTime",mobile:mobile,sid:"111502",tid:"21"},
      function(json)
      {
         data=json[0].info;
         if(data== "获取密码成功，请注意查收！" || data=="注册成功，验证码已经发送到您手机，请注意查收！") 
         {
              MM_showHideLayers('fgzsj','','hide');DivDoNotMask();
         }
         else
         {
             //alert(data);
             main.ShowMessage(data,3000);
         }
      }
      );
     
   }
   else
   {
      //alert("请输入正确的手机号！");
      main.ShowMessage("请输入正确的手机号！",3000);
      return false;
   }
}



function gotoIndex(){
    var d=new Date();
    var code=document.getElementById('suggest1').value;
    //判断code是否是正常6位代码
    if(code=='')
    {
       //alert("请输入股票代码！");
       main.ShowMessage("请输入股票代码！",3000);
       return false;
    }
    var numcode='';
    if(IsString(code))
    {
        for(var i=0;i<EALists.length;i++)
        {
            code=code.toLowerCase();
            if(EALists[i]["_R"]==code)
            {
                numcode=EALists[i]["_C"];
                window.location.href='airport.html?id='+numcode+"&time="+d.getTime();
                break;
            }
        }
        if(numcode=='')
           //alert("请确认您输入的股票代码!");
           main.ShowMessage("请确认您输入的股票代码!",3000);
    }
    else
    {
       var isRight=0;
        for(var i=0;i<EALists.length;i++)
        {
            code=code.toLowerCase();
            if(EALists[i]["_C"]==code)
            {
                numcode=EALists[i]["_C"];
                window.location.href='airport.html?id='+code+'&type=GOODS&time='+d.getTime();
                //window.location.href='airport.html?id='+numcode;
                isRight=1;
                break;
            }
        }
        if( isRight==0)
        {
              //alert("请确认您输入的股票代码!");
              main.ShowMessage("请确认您输入的股票代码!",3000);
              return false;
        }
    }
	  //window.location.href='airport.html?id='+code+'&type=GOODS&time='+d.getTime();
}


function gotoStock(){

    var code=document.getElementById('suggest1').value;
     if(code=='')
    {
       //alert("请输入股票代码！");
       main.ShowMessage("请输入股票代码!",3000);
       return false;
    }
    //判断code是否是正常6位代码
    var numcode='';
    if(IsString(code))
    {
    //alert("bbb");
        for(var i=0;i<EALists.length;i++)
        {
            code=code.toLowerCase();
            if(EALists[i]["_R"]==code)
            {
                numcode=EALists[i]["_C"];
                InitialStockWithPic(numcode,"GOODS","TEN");
                //window.location.href='airport.html?id='+numcode;
                break;
            }
        }
        if(numcode=='')
          {
          //alert("请确认您输入的股票代码!");
          main.ShowMessage("请确认您输入的股票代码!",3000);
          return false;}
    }
    else
    {
        var isRight=0;
        for(var i=0;i<EALists.length;i++)
        {
            code=code.toLowerCase();
            if(EALists[i]["_C"]==code)
            {
                numcode=EALists[i]["_C"];
                InitialStockWithPic(numcode,"GOODS","TEN");
                //window.location.href='airport.html?id='+numcode;
                isRight=1;
                break;
            }
        }
        if( isRight==0)
        {
              //alert("请确认您输入的股票代码!"); 
              main.ShowMessage("请确认您输入的股票代码!",3000);
              return false;
        }
	   //InitialStockWithPic(code,"GOODS");
	}
  MM_showHideLayers('gpdm','','hide');DivDoNotMask();
}


//首行加粗
function FirstLineStrong(strContent)
{
   var strReturn="";
   if(strContent!=undefined)
   {
   var strLines=strContent.split("<br/>");
  
   for( i=0;i<strLines.length;i++)
   {
      if(i==0)
      {
         strReturn ="<strong>"+strLines[i]+"</strong><br/>";
      }
      else
      {
         strReturn=strReturn+strLines[i]+"<br/>";
      }
   }
   }
   return strReturn;
}

//字符串中的所有数字以颜色显示
function ChangeNumColor(strContent)
{

  var strReturn="";
  if(strContent!=undefined)
  {

    for(i=0;i<strContent.length;i++)
    {
       if(!isNaN(strContent[i])&&strContent[i]!='')
       {
          strReturn =strReturn+"<span class='z_yellow'>"+strContent[i]+"</span>";
       }
       else
       {
          strReturn=strReturn+strContent[i];
       }
    }
  }
  return strReturn;
}



//明日特色
function GetMrts(id,type)
{
    if(id==""||id==undefined)
    {
          $('span[name=mrTomorrowYear]').html("");
	      $('span[name=mrTomorrowTime]').html("");
	      $('div[name=mrTomorrowInfo]').html("");
		 return false ;	
	}
	else
	{
        $.getJSON(strAirport+"Airport22.ashx?jsoncallback=?",{action: "GetMrtsByKey",code:id,type:type},
        function(json)
        {	
            var data=eval(json[0].info);
            //debugger;
            
	        if(data[0].D[0].C!="")
	        {
	          
	          var time=data[0].D[0].T;
	          if(time!=undefined)
	          {
	              time =String(time);
	              var year;
	              year=time.substring(0,4)
	              time=time.substring(4,6)+"/"+time.substring(6,8);
	              $('span[name=mrTomorrowYear]').html(year);
	              $('span[name=mrTomorrowTime]').html(time); 
	          } 
	          //首行加粗
	          var info=FirstLineStrong(data[0].D[0].TM);
	          //数字变黄色
	          info=ChangeNumColor(info);
	          $('div[name=mrTomorrowInfo]').html(info);
	        }
	        if(data[1].D[0].C!="")
	        {
	          var time=data[1].D[0].T;
	          if(time!=undefined)
	          {
	              time =String(time);
	              var year;
	              year=time.substring(0,4)
	              time=time.substring(4,6)+"/"+time.substring(6,8);
	              $('span[name=mrTodayYear]').html(year);
	              $('span[name=mrTodayTime]').html(time); 
	          }
	          //首行加粗
	          var info=FirstLineStrong(data[1].D[0].TM);   
	          //数字变黄色
	          info=ChangeNumColor(info);
	          $('div[name=mrTodayInfo]').html(info);
	         
	        }      
        });
    }
}

//个股信息
function GetGGInfo(data)
{
      var d=new Date();
      $('#today').html(d.getFullYear()+"-"+(d.getMonth()+1)+"-" +d.getDate());
      $('#name').html(data[0].N);
      $('#code').html(data[0].C);
      $('#cyjj').html(data[0].CYJJ);
      $('#cyjj').attr("class","color_red");
    
    var sword="";
    if(data[0].V!=0)
    {
        //箭头
        if(data[0].P>data[0].Y)
        {
             $('#zhangdiesword').attr("src","images/airport/jrhq_up.png");
             sword="↑";
        }
        else
        {
            $('#zhangdiesword').attr("src","images/airport/jrhq_down.png");
            sword="↓";
        }
      
        $('#zuixin').html(data[0].P.toFixed(2)); 
        $('#zuixin').attr("class",GetColorByCompare(data[0].P,data[0].Y));  
        $('#kaipan').html(data[0].O.toFixed(2));
        $('#kaipan').attr("class",GetColorByCompare(data[0].O,data[0].Y));  
        $('#zhangdie').html(data[0].D.toFixed(2));
        $('#zhangdie').attr("class",GetColorByCompare(data[0].F,0));  
        $('#zhangfu').html(sword+data[0].F+"%");
        $('#zhangfu').attr("class",GetColorByCompare(data[0].F,0));  
        $('#zuigao').html(data[0].H.toFixed(2));
        $('#zuigao').attr("class",GetColorByCompare(data[0].H,data[0].O));  
        $('#liangbi').html(data[0].LB);    
        $('#zhongshou').html(data[0].V);
        $('#huanshou').html(data[0].I+"%");
        $('#junjia').html(data[0].AV);  
        $('#junjia').attr("class",GetColorByCompare(data[0].AV,data[0].O));
        $('#zuidi').html(data[0].L.toFixed(2));
        $('#zuidi').attr("class",GetColorByCompare(data[0].L,data[0].O));
        $('#qiangruo').html(data[0].QR);   //强弱
        $('#xianshou').html(data[0].XS);   //现手
        $('#5ri').html(data[0].F5+"%"); 
        $('#zjlr').html(ChangeValueUnits(data[0].J));  //资金流入\
      
       
        $('span[type=sinfo]').attr("class",GetColorByCompare(data[0].O,data[0].Y));  
    }
    else
    {
       $('#zhangdiesword').attr("src","images/airport/jrhq_up.png");
       sword="↑";
    
       $('span[name=ginfo]').html('--');
       $('#zhangfu').html(sword+"0.00%");
    }
    
}

//测试
function TestPost()
{

  $.getJSON("http://live.emoney.cn/airport22/Airport22.ashx?jsoncallback=?",{action:"TestJsonP"},
      function(json)
      {  
          var data;
          data=eval(json[0].info);
          alert(data[1].D[0].C);
      }
      );
}

//马力表
function GetCWB(type)
{
    $.getJSON(strAirport+"Airport22.ashx?jsoncallback=?",{action:"GetCWB"},
      function(json)
      {  
      
         var data;
         data=eval(json[0].info);
         var m;
         var n=data[0].CWB;
         switch(n)
         {
            case 0:
               m="5";
            break; 
            case 1:
             m="15";
            break; 
            case 2:
             m="25";
            break; 
            case 3:
             m="40";
            break; 
            case 4:
             m="55";
            break; 
            case 5:
             m="65";
            break; 
            case 6:
             m="75";
            break; 
            case 7:
             m="90";
            break; 
         }
         if(type=="small")
         {
            $('#cwb').attr("src","images/airport/cwbsmall"+m+".jpg");
         }
         else
         {
            $('#adpic').attr("src","images/airport/cwb"+m+".jpg");
         }
      }
      );
}


//红与蓝
function GetRedBlue()
{
     $.getJSON(strAirport+"Airport22.ashx?jsoncallback=?",{action:"GetRedBlue"},
      function(json)
      { 
 
            var data=eval(json[0].info);
            //alert(data[1].D[0].C);
            var red_table="";
            red_table= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
            red_table=red_table+"<tr>";
            red_table=red_table+"<td align=\"center\" bgcolor=\"#403f41\">股票</td>";
            red_table=red_table+"<td align=\"center\" bgcolor=\"#403f41\">收益</a></td>";
            red_table=red_table+"<td align=\"center\" bgcolor=\"#403f41\">入榜日</td>";
            red_table=red_table+"<td align=\"center\" bgcolor=\"#403f41\">入选价</td>";
            red_table=red_table+"</tr>";
                
            red_table=red_table+"<tr>";
            red_table=red_table+"<td height=\"10\" colspan=\"4\"></td>";
            red_table=red_table+" </tr>";
            
            
            var red_count=0;
            
            if(data[0].D[0]!=undefined)
            {
               if(data[0].D[0].C!="" )
	           {    
	             red_count=data[0].D.length;
	             if(red_count>4)
	               red_count=4;
	             for(i=0;i<red_count;i++)
	             {
	                 var redday= data[0].D[i].DATE.substring(2,4)+"/"+data[0].D[i].DATE.substring(4,6)
	                 if(i==0)
	                 {
	                       red_table=red_table+"<tr onclick=\"InitialStockWithPic('"+data[0].D[i].C+"','GOODS','RB');GetRBTR('RB"+data[0].D[i].C+"');\" background=\"images/airport/sdhq6.png\"  name='RB' rbid='RB"+data[0].D[i].C+"'>";
	                       $('#redbluecode').val(data[0].D[i].C);          
	                 }
	                 else
	                 {
	                       red_table=red_table+"<tr onclick=\"InitialStockWithPic('"+data[0].D[i].C+"','GOODS','RB');GetRBTR('RB"+data[0].D[i].C+"');\" name='RB' rbid='RB"+data[0].D[i].C+"' >";
	                 }
	              
                     red_table=red_table+"<td height=\"33\" align=\"center\" class=\"color_org\" ><a href=\"javascript:void(0)\">"+data[0].D[i].N+"</a></td>";
                     red_table=red_table+"<td align=\"center\" >+"+parseFloat(data[0].D[i].F*100).toFixed(2)+"%</td>";
                     red_table=red_table+"<td align=\"center\" >"+redday+"</td>";
                     red_table=red_table+"<td align=\"center\" >"+data[0].D[i].P+"<img src=\"images/airport/sdhq5.png\" hspace=\"2\" /></td>";
                     red_table=red_table+"</tr>";
	             }
	           }
            }
            else
            {
                    red_table=red_table+"<tr align=\"center\"><td height=\"33\" align=\"center\" ><span style=\"color:#FFFF00\" >暂无</span></td><td align=\"center\" ><span style=\"color:#FFFF00\" >符合</span></td><td align=\"center\" ><span style=\"color:#FFFF00\" >条件</span></td><td align=\"center\" ><span style=\"color:#FFFF00\" >股票</span></td></tr>";
                    red_table=red_table+"<tr align=\"center\"><td height=\"33\" align=\"center\" >-----</td><td align=\"center\" >-----</td><td align=\"center\" >-----</td><td align=\"center\" >-----</td></tr>";
                    red_table=red_table+"<tr align=\"center\"><td height=\"33\" align=\"center\" >-----</td><td align=\"center\">-----</td><td align=\"center\" >-----</td><td align=\"center\" >-----</td></tr>";
                    red_table=red_table+"<tr align=\"center\"><td height=\"33\" align=\"center\" >-----</td><td align=\"center\" >-----</td><td align=\"center\" >-----</td><td align=\"center\" >-----</td></tr>";
       
            }
            
            red_table=red_table+" <tr>";
            red_table=red_table+"<td height=\"23\" colspan=\"4\" align=\"center\"></td>";
            red_table=red_table+"</tr>";
	        red_table=red_table+"</table>";
	        $('#red_table').html(red_table);
	        $('#red_table1').html(red_table);
	        
	        var blue_table="";
	        blue_table= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
            blue_table=blue_table+"<tr>";
            blue_table=blue_table+"<td align=\"center\" bgcolor=\"#403f41\">股票</td>";
            blue_table=blue_table+"<td align=\"center\" bgcolor=\"#403f41\">收益</a></td>";
            blue_table=blue_table+"<td align=\"center\" bgcolor=\"#403f41\">入榜日</td>";
            blue_table=blue_table+"<td align=\"center\" bgcolor=\"#403f41\">入选价</td>";
            blue_table=blue_table+"</tr>";
            blue_table=blue_table+"<tr>";
            blue_table=blue_table+"<td height=\"10\" colspan=\"4\"></td>";
            blue_table=blue_table+"</tr>";
            if(data[1].D[0]!=undefined)
            {
               if(data[1].D[0].C!="")
	           {
	             var blue_count=data[1].D.length;
	             if(blue_count>4)
	               blue_count=4;
	             for(i=0;i<blue_count;i++)
	             {
 	                 var blueday= data[1].D[i].DATE.substring(2,4)+"/"+data[1].D[i].DATE.substring(4,6)
	                 if(i==0 && red_count==0)
	                 {	           
	                      blue_table=blue_table+"<tr onclick=\"InitialStockWithPic('"+data[1].D[i].C+"','GOODS','RB');GetRBTR('RB"+data[1].D[i].C+"'); \"  background=\"images/airport/sdhq6.png\" name='RB' rbid='RB"+data[1].D[i].C+"' >";
	                      $('#redbluecode').val(data[1].D[i].C);
	                 }
	                 else
	                 {
	                      blue_table=blue_table+"<tr onclick=\"InitialStockWithPic('"+data[1].D[i].C+"','GOODS','RB');GetRBTR('RB"+data[1].D[i].C+"');\" name='RB' rbid='RB"+data[1].D[i].C+"' >";
	                 }
	                 //blue_table=blue_table+"<tr onclick=\"InitialStockWithPic('"+data[1].D[i].C+"','GOODS')\"  background=\"images/airport/sdhq6.png\">";
                     blue_table=blue_table+"<td align=\"center\" class=\"color_org\" height=\"33\"><a href=\"javascript:void(0)\" >"+data[1].D[i].N+"</a></td>";
                     blue_table=blue_table+"<td align=\"center\" >+"+parseFloat(data[1].D[i].F*100).toFixed(2)+"%</td>";
                     blue_table=blue_table+"<td align=\"center\" >"+blueday+"</td>";
                     blue_table=blue_table+"<td align=\"center\" >"+data[1].D[i].P+"<img src=\"images/airport/sdhq5.png\" hspace=\"2\" /></td>";
                     blue_table=blue_table+"</tr>";
	             }
	           
	             
	            }   
            }
            else
            {
                    blue_table=blue_table+"<tr  height=\"36\" align=\"center\"><td align=\"center\">1</td><td align=\"center\" class=\"color_org\"><a href=\"javascript:void(0)\" >-----</a></td><td align=\"center\" >-----</td><td align=\"center\" >-----</td><td align=\"center\" >-----</td></tr>";
                    blue_table=blue_table+"<tr  height=\"36\" align=\"center\"><td align=\"center\">2</td><td align=\"center\" class=\"color_org\"><a href=\"javascript:void(0)\" >-----</a></td><td align=\"center\" >-----</td><td align=\"center\" >-----</td><td align=\"center\" >-----</td></tr>";
                    blue_table=blue_table+"<tr height=\"36\" align=\"center\"><td align=\"center\">3</td><td align=\"center\" class=\"color_org\"><a href=\"javascript:void(0)\" >-----</a></td><td align=\"center\" >-----</td><td align=\"center\" >-----</td><td align=\"center\" >-----</td></tr>";
            }
        
            blue_table=blue_table+" <tr>";
            blue_table=blue_table+"<td height=\"50\" colspan=\"4\" align=\"center\">【个股为历史业绩   请勿盲目追高】</td>";
            blue_table=blue_table+"</tr>";
            blue_table=blue_table+"</table>";
            $('#blue_table').html(blue_table);
            $('#blue_table1').html(blue_table);
      }
      ); 
}

function GetStockInfo(id,type)
{
  //股票历史

  var stocklist=$('#stocklist').val().split(',');
  if(type!='INDEX')
  {
      if(stocklist.length>=3)
      {
         if($('#stocklist').val().indexOf(id)==-1)
         {
            stocklist.shift();
            stocklist.push(id);
         }   
      }
      else
      {
         if($('#stocklist').val().indexOf(id)==-1)
         {
            stocklist.push(id);
            if($('#stocklist').val()=='')
            {
               stocklist.shift();
            }
         } 
      }
  }
//no need
//  $('#stocklist').val(stocklist);
//  $('#ul_stockhistory').html('');
//  for(i=0;i<stocklist.length;i++)
//  {
//     if(stocklist[i]!='')
//     {
//       $('#ul_stockhistory').append("<li><a href=\"javascript:void(0)\"  onclick=\"InitialStockWithPic('"+stocklist[i]+"','GOODS','TEN');GetDisappear('stockhistory');\" class=\"b\">"+stocklist[i]+"</a></li>");   //
//      }
//  }
  
  //--------------
  var key='';
  switch(type)
    {
      case "GOODS":
      key="EMONEY_DATA_1.0_QUOTES_GOODS_";
      break;
      case "GROUP":
      
      break;
      case "WARRANTS":
      break;
      case "INDEX":
      key="EMONEY_DATA_1.0_QUOTES_INDEX_"
      break;
    }
    $.getJSON(strAirport+"Airport22.ashx?jsoncallback=?",{action:"GetCurrentInfoByKey",key:key+id,code:id,type:type},
      function(json)
      {            
          var data=eval(json[0].info);
          //如果是指数，获得时间
          if(type=="INDEX")
          {
             $('#indexdate').val(data[0].TT);
             GetGGInfo(data);     
          }
          else
          {
          
              if(data[0].TT!=$('#indexdate').val())
              {
                   var d=new Date();
                   $('#today').html(d.getFullYear()+"-"+(d.getMonth()+1)+"-" +d.getDate());
                   $('#name').html(data[0].N);
                   $('#code').html(data[0].C);
                   $('span[name=ginfo]').html('--');
                   $('#zhangfu').html(sword+"0.00%");
              }
              else
              {
                   GetGGInfo(data);     
              }
             
          }
        
      }
      );
   
   GetSDHQ(id,type);
   
   clearTimeout(document.getElementById("ggrefreshtime").value); 
   var timeoutid= window.setTimeout("GetStockInfo('"+String(id)+"','"+type+"')", 10000);
   document.getElementById("ggrefreshtime").value=timeoutid
}

//十档&饼
function GetSDHQ(code,type)
{
    var d=new Date();  
    $('#lhkp_img').attr("src",strAirportPic+"ashx/StockImg.ashx?key=EMONEY_MAP_AT_"+type+"_LHKP_"+code+"_214x307&ImgType=PNG&Ip=Airport_Index2_10&time="+d.getTime());
    $('#lhkp_img1').attr("src",strAirportPic+"ashx/StockImg.ashx?key=EMONEY_MAP_AT_"+type+"_LHKP_"+code+"_214x307&ImgType=PNG&Ip=Airport_Index2_10&time="+d.getTime());
    
    
    $('#sdhq_img').attr("src","http://222.73.125.95:8080/?id="+code+"&t=1&p=1&i=vol&w=220&h=288&c=128&pj=airport&time="+d.getTime());  
    //$('#sdhq_img').attr("src",strAirportPic+"ashx/StockImg.ashx?key=EMONEY_MAP_AT_"+type+"_MMP_"+code+"_214x263&ImgType=PNG&Ip=Airport_Index2_10&time="+d.getTime());  
   // alert("http://172.28.3.47:8080/?id="+code+"&t=1&p=1&i=vol&w=220&h=288&c=128&pj=airport");
 
 
}

function GetRBTR(obj)
{
   $('tr[rbid='+obj+']').attr("background","images/airport/sdhq6.png");
   MM_swapImage('cwmlb1','','images/airport/an27bh.png',1);MM_showHideLayers('RB2','','show','lhkp','','hide','sdhq','','hide');
   //   $('tr[name="RB"]').attr("background","");
}


//上屏注释
function kx_1_next()
{
    if($('#k1_1').css('display')=='block')
    {
        $('#k1_1').css('display','none');
        $('#k1_2').css('display','block');
    }
    else
    {
       $('#k1_1').css('display','block');
       $('#k1_2').css('display','none');
    }
}
//下屏注释
function kx_2_next()
{
    if($('#k2_1').css('display')=='block')
    {
        $('#k2_1').css('display','none');
        $('#k2_2').css('display','block');
    }
    else
    {
       $('#k2_1').css('display','block');
       $('#k2_2').css('display','none');
    }
}


//下屏注释
function kx_3_next()
{
    if($('#k3_1').css('display')=='block')
    {
        $('#k3_1').css('display','none');
        $('#k3_2').css('display','block');
    }
    else
    {
       $('#k3_1').css('display','block');
       $('#k3_2').css('display','none');
    }
}




